package com.molichuxing.services.infrastructure.dao;

import com.molichuxing.framework.dao.RootMapper;
import com.molichuxing.framework.dto.TabDto;
import com.molichuxing.services.infrastructure.bean.InvoiceInfoBean;
import com.molichuxing.services.infrastructure.dto.request.create.InvoiceInfoCreateDto;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 发票申请 Mapper 接口
 * </p>
 *
 * @author zhaopenghui
 * @since 2019-09-20
 */
public interface InvoiceInfoMapper extends RootMapper<InvoiceInfoBean> {

    /**
     * 根据条件分页查询count
     *
     * @param params
     * @return
     */
    long getPageCount(@Param("params") Map<String, Object> params);

    /**
     * 根据条件分页查询
     *
     * @param params
     * @param pageNum
     * @param pageSize
     * @return
     */
    List<InvoiceInfoBean> getPage(@Param("params") Map<String, Object> params, @Param("pageNum") int pageNum,
                                  @Param("pageSize") int pageSize);

    /**
     * 根据状态获取发票数量
     *
     * @return
     */
    List<TabDto> getInvoiceCountByStatus();

    /**
     * 修改发票状态
     *
     * @param id
     * @param status
     * @return
     */
    int modifyStatusById(@Param("id") Integer id, @Param("status") Integer status);

    /**
     * 批量添加发票
     *
     * @param invoiceInfoList
     * @return
     */
    int createInvoiceInfoBatch(List<InvoiceInfoCreateDto> invoiceInfoList);


}